<?php
session_start();

include("../includes/custom/AuthManager.php");

$user_id = $_POST["username"];

            $password = $_POST["password"];

            $auth_manager = new AuthManager($user_id, $password);

            $auth_result = $auth_manager->authenticate();

            //$location = "http://localhost:8080/poapprovals/web/library.php";
            $location = "../library.php";

            if($auth_result != FALSE)
            {
                $_SESSION["username"] = $user_id;
                $_SESSION["password"] = $password;
                $_SESSION["user_is_admin"] = $auth_result;

                //header("Location: library.php");
            }
            else
            {
                //$location = "http://localhost:8080/poapprovals/web/login.php";
                $location = "../login.php";
            }

            header("Location: " . $location);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login - Bitzer</title>
</head>
<body>
        
</body>
</html>